<%--
  Created by IntelliJ IDEA.
  User: xuweijie
  Date: 17-5-17
  Time: 下午7:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/header.jsp" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Register</title>
    <!-- JqueryUI -->
    <link rel="stylesheet" type="text/css" href="${style}/front/jquery-ui.css">

    <link rel="stylesheet" type="text/css" href="${style}/animate.min.css">
    <link rel="stylesheet" type="text/css" href="${style}/input.css">
    <!-- Bootstrap -->
    <link rel="stylesheet" type="text/css" href="${style}/front/bootstrap.min.css">
    <!-- Awesome font icons -->
    <link rel="stylesheet" type="text/css" href="${style}/front/font-awesome.min.css" media="screen">
    <!-- Owlcoursel -->
    <link rel="stylesheet" type="text/css" href="${style}/front/owl-coursel/owl.carousel.css">
    <link rel="stylesheet" type="text/css" href="${style}/front/owl-coursel/owl.transitions.css">
    <!-- Magnific-popup -->
    <link rel="stylesheet" type="text/css" href="${style}/front/magnific-popup/magnific-popup.css">
    <!-- Style -->
    <link rel="stylesheet" type="text/css" href="${style}/front/style.css" media="screen">
    <!-- Fw -->
    <link rel="stylesheet" type="text/css" href="${style}/front/fw.css" media="screen">

    <link rel="stylesheet" type="text/css" href="${style}/input.css">
    <link rel="stylesheet" href="${Layui}/css/layui.css" media="all">

</head>
<body>
<%--herder--%>
<jsp:include page="../header.jsp"/>

<section class="m-t-0">
    <div class="container m-t-30">
        <h3 class="title f-30">个人中心</h3>
        <%--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit</p>--%>
        <div class="row ht-tabs ht-tabs-product">
            <div class="col-md-3 col-lg-2 pull-left-xs">
                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li class="panel panel-default">
                        <a href="/front/mybuycar/buycarlist">购物车</a>
                    </li>
                    <li class="panel panel-default">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapse1">我的订单</a>
                        <div id="collapse1" class="panel-collapse collapse in">
                            <ul class="panel-body">
                                <li>
                                    <a href="/front/purchase/alls">全部</a>
                                </li>
                                <li>
                                    <a href="/front/purchase/waits">待付款</a>
                                </li>
                                <li>
                                    <a href="/front/purchase/payed">待发货</a>
                                </li>
                                <li>
                                    <a href="/front/purchase/sent">待收货</a>
                                </li>
                                <li>
                                    <a href="/front/purchase/done">已完成</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li class="panel panel-default">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapse2">优惠券</a>
                        <div id="collapse2" class="panel-collapse collapse in">
                            <ul class="panel-body">
                                <li role="presentation">
                                    <a href="/front/mycoupons/showdetail">全部优惠券</a>
                                </li>
                                <li role="presentation">
                                    <a href="/front/mycoupons/showdetailbyMycoupons">我的优惠券</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li class="panel panel-default">
                        <a href="/front/wallet">我的钱包</a>
                    </li>
                    <li class="panel panel-default">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapse4">个人信息管理</a>
                        <div id="collapse4" class="panel-collapse collapse in">
                            <ul class="panel-body" >
                                <li role="presentation" class="active">
                                    <a href="/front/persion/showMyInfo">我的信息</a>
                                </li>
                                <li role="presentation">
                                    <a href="/front/address/showaddress">地址管理</a>
                                </li>
                                <li role="presentation">
                                    <a href="/front/persion/showupdatepwd">修改密码</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="col-md-9 col-lg-10">
                <!-- 主要显示区域-->
                <div class="content">
                    <form class="form-horizontal" role="form" method="post"  action="/front/persion/updatecusdata">
                        <div class="site-demo-upload" style="margin-left: 150px;margin-bottom: 30px;">
                            <img id="LAY_demo_upload" src="${customer.photo}" style="margin-bottom: 30px; width: 150px;height: 150px;">
                            <input hidden type="text" value="${customer.photo}" name="myphoto" id="hiphoto">
                            <div class="site-demo-upbar">
                                <input type="file" name="photo" class="layui-upload-file" id="uploadphoto">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">用户名</label>
                            <div class="col-sm-10">
                                <input class="form-control" id="focusedInput" type="username" name="username" value="${customer.username}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">性别</label>
                            <div class="col-sm-8" style="margin-top: 7px;">
                                <label style="margin-right: 15px;">
                                    <i class='input_style radio_bg <c:if test="${customer.sex=='男'}">radio_bg_check</c:if>'><input class="radio-inline" type="radio" name="sex" <c:if test="${customer.sex=='男'}">checked="checked"</c:if> value="男"></i>男
                                </label>
                                <label>
                                    <i class='input_style radio_bg <c:if test="${customer.sex=='女'}">radio_bg_check</c:if>'><input class="radio-inline" type="radio" name="sex" <c:if test="${customer.sex=='女'}">checked="checked"</c:if> value="女"></i>女
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员类型</label>
                            <div class="col-sm-10">
                                <input class="form-control" id="type" type="username"  value="${SysDict['customer_type'][customer.type]}" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号码</label>
                            <div class="col-sm-10">
                                <input class="form-control" id="phone" name="phone" type="username"  value="${customer.phone}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">邮箱地址</label>
                            <div class="col-sm-10">
                                <input class="form-control" id="email" name="email" type="username"  value="${customer.email}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">注册时间</label>
                            <div class="col-sm-10">
                                <input class="form-control" id="signtime" type="username"  value="<fmt:formatDate value="${customer.signdate}" pattern="yyyy-MM-dd HH:mm:ss" />" disabled>
                            </div>
                        </div><br><br>
                        <div class="form-group" style="margin-left: 160px;">
                            <button type="submit" class="btn btn-primary btn-lg">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>

<%--footer--%>
<jsp:include page="../footer.jsp"/>

<!-- jQuery -->
<script src="${jquery}/jquery.js" charset="utf-8"></script>

<!-- JqueryUI -->
<script src="${jquery}/jquery-ui.js"></script>
<!-- Bootstrap -->
<script src="${Bootstrap}/js/bootstrap.js"></script>
<!-- Owl-coursel -->
<script src="${Js}/front/owl-coursel/owl.carousel.js"></script>
<!-- Magnific-popup -->
<script src="${Js}/front/magnific-popup/jquery.magnific-popup.min.js"></script>
<!-- Script -->
<script src="${Js}/front/script.js"></script>
<script src="${Layui}/layui.js" charset="utf-8"></script>
<script text="type/javascript" src="${Js}/front/input.js"></script>
<script>
    layui.use('upload', function(){
        layui.upload({
            url: '/uploadphoto.action',
            elem: '#uploadphoto',
            method: 'post',
            success: function(res){
                var responseObj=eval('('+res+')');
                var code=responseObj.code;
                if(code===0){
                    var photourl=responseObj.data.access_url;
                    console.log(photourl);
                    console.log(code);
                    $("#LAY_demo_upload").attr("src",photourl);
                    $("#hiphoto").val(photourl);
                    layer.msg("上傳成功");
                }else{
                    layer.msg("上傳失敗");
                }
            }
        });
    });

</script>
</body>
</html>

